import 'dart:io';

import 'package:flustars/flustars.dart';
import 'package:path_provider/path_provider.dart';

class PathHelper {
  static Future<String> getLocalPath() async {
    final directory = Platform.isAndroid
        ? await getExternalStorageDirectory()
        : await getApplicationDocumentsDirectory();
    LogUtil.v('getLocalPath: ${directory.path}');
    return directory.path;
  }

  static Future<String> getFilePath(String path) async {
    var _localPath = (await getLocalPath()) + path;
    var _saveDir = Directory(_localPath);
    if (!await _saveDir.exists()) {
      await _saveDir.create();
    }
    return _saveDir.path;
  }

  static Future<String> getImagePath() async {
    return await getFilePath('/ShareScreenShots');
  }
}
